'''
author: leiwenhui
version：v1
file_name: 从字符串中随机取两个字符然后排序
'''
import random
from collections import Counter

str1 = 'abcdefghijklmnopqrstuvwxyz'


def get_random_str(str_a):
    random_a = random.choice(str_a)
    random_b = random.choice(str_a)
    return random_a+''+random_b


def get_list(int_num):
    lst_1 = []
    for i in range(0, int_num):
        lst_1.append(get_random_str(str1))
    return lst_1


def sort_list(lst1):
    result = Counter(lst1)
    sort_value = sorted(result.items(), key=lambda x: x[1], reverse=True)
    return sort_value


if __name__ == '__main__':
    sort_str = sort_list(get_list(100))
    print(sort_str)
    

# 完成的不错
